package easy.trace.agent.support;

import org.apache.commons.lang3.StringUtils;

public class TracerUtils {
    public static final String TID = "traceId";
    public static final String SID = "spanId";
    public static final String PID = "parentId";
    public static final String SAMPLE = "isSample";
    public static final String EXCEPTION = "dubbo.exception";

    public TracerUtils() {
    }

    public static Long getAttachmentLong(String value) {
        return StringUtils.isBlank(value) ? null : Long.valueOf(value);
    }

    public static Boolean getAttachmentBoolean(String value) {
        return value == null ? false : Boolean.valueOf(value);
    }
}

